<!DOCTYPE html>
<html>
    <head>
        <title>大厂面试第二季 - 幕布</title>
        <meta charset="utf-8"/>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta name="renderer" content="webkit"/>
        <meta name="author" content="mubu.com"/>
    </head>
    <body style="margin: 50px 20px;color: #333;font-family: SourceSansPro,-apple-system,BlinkMacSystemFont,'PingFang SC',Helvetica,Arial,'Microsoft YaHei',微软雅黑,黑体,Heiti,sans-serif,SimSun,宋体,serif">
        <div class="export-wrapper">
            <div style="font-size: 22px; padding: 0 15px 0;">
                <div style="padding-bottom: 24px">大厂面试第二季</div>
                <div style="background: #e5e6e8; height: 1px; margin-bottom: 20px;"></div>
            </div>
            <ul style="list-style: disc outside;">
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">对volatile的理解</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">volatile是Java虚拟机提供的轻量级的同步机制 <span
                                class="tag" style="text-decoration: underline; opacity: 0.6; color: inherit;">#笔试</span></span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">三大特性</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node" color="#333333"
                                                                             style="color: rgb(51, 51, 51); line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">保证可见性</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">一个线程修改主内存值后，其它内存立即可见。</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node" color="#dc2d1e"
                                                                             style="color: rgb(220, 45, 30); line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">不保证原子性</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node" color="#333333"
                                                                             style="color: rgb(51, 51, 51); line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">禁止指令重排</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">JMM（java内存模型）</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">Java Memory Model，是一种抽象概念，本身并不在存在。它描述的是一组规则或规范，通过这组规范定义了程序中各个变量（包括实例字段，静态字段和构成数组对象的元素）的访问方式。​</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">关于同步的规定</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">线程解锁前，必须把共享变量的值刷新回主内存</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">线程加锁前，必做读取主内存的最新值到自己的工作内存</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">加锁解锁是同一一把锁</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">具体说明</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">由于JVM运行程序的实体是线程，而每个线程创建时都会为其创建一个工作内存（栈空间），工作内存是每个线程的私有数据区域。​Java内存模型中规定所有变量都存储在`主内存`，主内存是共享内存区域，所有线程都可以访问，但线程对变量的操作（读取赋值等）必须在工作内存中进行，首先要将变量从主内存拷贝到自己的工作内存空间，然后对变量进行操作，操作完成后再将变量写回主内存，不能直接操作主内存中的变量。​各个线程中的工作内存中存储着主内存中的变量副本拷贝，因此不同的线程间无法访问对方的工作内存，线程间的通信（传值）必须通过主内存来完成。 </span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">特性</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">可见性</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">及时通知其它线程，主物理内存的值已经改变</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">原子性</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">不可分割，即某个线程正在做某个具体业务时，中间不可以被分割或者加塞。需要整体完整。同时成功或同时失败。​</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">number++是非线程安全的</span>
                                                </li>
                                            </ul>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">有序性</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">指令重排</span><br><span
                                                        class="note"
                                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">源代码→编译器优化的重排→指令并行的重排→内存系统的重排→最终执行指令必须考虑数据依赖性​​​</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">内存屏障(Memory Barrier)</span><br><span
                                                                class="note"
                                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">又称内存栅栏。是一个CPU指令。​</span>
                                                            <ul class="children"
                                                                style="list-style: disc outside; padding-bottom: 4px;">
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">保证特定操作的执行顺序</span>
                                                                </li>
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">保证某些变量的内存可见性</span>
                                                                </li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">哪些地方用到volatile</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">DCL</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">双端检锁机制不一定安全，原因是有指令重排的存在，加入valatile可以禁止指令重排。某个线程执行第一次检测时，读取到的null可能是没有，也可能是没有完成初始化。指令重排只会保证串行语义执行的一致性，不关心多线程间的语义一致性。可能导致​​​判断不为null，但实际引用为null，造成线程安全问题。</span>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">AtomicInteger的ABA问题</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ABA</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">狸猫换太子​。CAS算法需要取出内存中某时刻的数据并在当下时刻比较并替换，在这个时间差内会导致数据的变化。T1线程拷贝主内存值运算期间，T2线程将主内存值A改为B又改为A。结果是T1运算结束后能正常更新值，但这期间，A的值被改变过。​​</span>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">原子引用</span>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ArrayList线程不安全</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">故障现象</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">java.util.ConcurrentModificationException</span>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">导致原因</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">并发争抢修改导致。</span>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">解决方案</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">new Vector&lt;&gt;();</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Collections.synchronizedList(new ArrayList&lt;&gt;());</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">new CopyOnWriteArrayList&lt;&gt;();</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">可并发的读。读写分离</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">优化建议</span>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">锁</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">公平和非公平锁</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">是什么</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">公平锁</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">指多个线程按照申请锁的顺序来获取锁，先来后到。</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">非公平锁</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">指获取锁的顺序与申请锁的顺序无关。在高并发的情况下，可能造成优先级反转或者饥饿现象​​</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">区别</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">公平锁在并发环境中，每个线程在获取锁时会先查看此锁维护的等待队列，如果为空或者当前线程是等待队列的第一个，就占有锁，否则就会加入到等待队列中，按照FIFO的规则从队列中取到自己。非公平锁直接尝试占有锁，如果尝试失败，再采用类似公平锁的方式​</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">题外话</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">非公平锁的优点在于吞吐量比公平锁大。对于Synchronized而言，是一种非公平锁​</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">可重入锁（递归锁）</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">是什么</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">指同一线程外层函数获得锁之后，内层递归函数仍然能获取该锁的代码。在同一个线程在外层方法获取锁的时候，在进入内层方法会自动获取锁。线程可以进入任何一个它已经拥有的锁所同步着的代码块​​</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ReentrantLock/Synchronized是典型的可重入锁</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">可重入锁的最大作用是避免死锁</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">自旋锁</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">指尝试获取锁的线程不会立即阻塞，而是采用循环的方式去尝试获取锁。可以减少线程上下文切换的开销，但是循环会消耗CPU​​</span>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">独占（写）锁/共享（读）锁/互斥锁</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">独占锁：指该一次只能被一个线程所持有。RentrantLock和Synchronized是独占锁。共享锁：指该锁可被多个线程所持有。RentrantReadWriteLock其读锁是共享锁，写锁是独占锁。​​</span>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">CountDownLatch/CyclicBarrier/Semaphore</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">CountDownLatch</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">让一些线程阻塞直到另一些线程完成一系列操作后才被唤醒</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">方法</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">await</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">调用await方法时，调用线程会被阻塞。当计数器的值变为0时，调用await方法被阻塞的线程会被唤醒。 </span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">countDown</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">调用此方法会将计数器减1，调用方法的线程不会被阻塞。</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">CyclicBarrier</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">让一组线程到达一个屏障（也可以叫同步点）时被阻塞，直到最后一个线程到达屏障时，屏障才会开门，所有被屏障拦截的线程才会继续工作</span>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Semaphore</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">信号量主要用于：1.多个共享资源的互斥使用；2，并发线程数的控制</span>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">队列</span><br><span
                        class="note"
                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">当阻塞队列是空时，从队列中获取元素的操作将会被阻塞。当阻塞队列是满时，往队列里添加元素的操作将会被阻塞​。</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">是什么</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ArrayBlockingQueue</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">是一个基于数组结构的有界阻塞队列，此队列按FIFO原则对元素进行排序。</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">LinkedBlockingQueue</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">基于链表结构的阻塞队列，按FIFO排序元素，吞吐量通常要高于ArrayBlockingQueue​</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">SynchronousQuere</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">一个不存储元素的阻塞bqqj。每个插入操作必须等到另一个线程调用移除操作，否则插入一直处于阻塞状态，吞吐量通常要高</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">BlockingQueue方法</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;"></span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">种类分析</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ArrayBlockingqueue</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">由数组组成的有界阻塞队列。</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">LinkedBlockingqueue</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">由链表结构组成的有界（但大小默认值为Integer.MAX_VALUE)阻塞队列​</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">PriorityBlcokingQueue</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">支持优先级排序的无界阻塞队列。​</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">DelayQueue</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">使用优先级队列实现的延迟无界阻塞队列。</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">SynchronousQueue</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">不存储元素的阻塞队列，也即单个元素的队列</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">LinkedTransferQueue</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">由链表结构组成的无界阻塞队列</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">LinkedBlockingDeque</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">由链表结构组成的双向阻塞队列</span>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">synchronized和lock有什么区别</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">原始构成</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">synchronized是关键字属于JVM层面</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">monitorenter底层是通过monito对象来完成，其实wait/notify等方法也依赖于monitor对象，只有在同步块或方法中才能调wait/notify等方法monitorexit​</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Lock是具体类(java.util.concurrent.locks.Lock)是api层面的锁</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">使用方法</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">synchronized不需要用户去手动释放锁，没synchronized代码执行完成后系统会自动让线程释放对锁的占用</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ReentrantLock则需要用户去手动释放锁，若没有主动释放锁，就有可能出现死锁现象。需要lock()和unlock()配合try/finally语句块完成</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">等待是否中断</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">synchronized不可中断，除非抛出异常或者正常运行完成</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ReentrantLock可中断</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">设置超时方法，tryLock(long timeout, TimeUnit unit)</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">lockInterruptibly()放代码块中，调用interrupt方法可中断</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">加锁是否公平</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">synchronized非公平锁</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ReentrantLock两者都可以，默认非公平锁</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">锁绑定多个条件condition</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">synchronized没有</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ReentrantLock用来实现分组唤醒需要唤醒的线程们，可以精确唤醒，而不是像synchronized要么随机唤醒一个线程要么唤醒全部线程</span>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">线程池</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">优势。主要特点：线程复用；控制最大并发数；管理线程</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">线程池做的工作主要是控制运行的线程的数量，处理过程中将任务放入队列，然后在线程创建后启动这些任务，如果线程数量超过了最大数量超出数量的线程排队等候，等其它线程执行完结，再从队列中取出任务来执行。​</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">降低资源消耗。通过重复利用已创建的线程降低线程创建和销毁造成的消耗</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">提高响应速度。当任务到达时，任务可以不需要的等到给线程创建就能立即执行。</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">提高线程的可管理性。线程是稀缺资源，如果无限制的创建，不仅会消耗系统资源，还会降低系统的稳定性，使用线程池可以进行统一的分配，调优和监控</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">如何使用</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">代码</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">newFixedThreadPool</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">newSingleThreadExecutor</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">newCachedThreadPool</span>
                                        </li>
                                        <li style="color: rgb(160, 160, 160); line-height: 24px;"><span
                                                class="content mubu-node finished"
                                                style="text-decoration: line-through; line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">newScheduledThreadPool</span>
                                        </li>
                                        <li style="color: rgb(160, 160, 160); line-height: 24px;"><span
                                                class="content mubu-node finished"
                                                style="text-decoration: line-through; line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">newWorkStealingPool</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">7大参数</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">corePoolSize:线程池中的常驻核心线程数</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">maximumPoolSize:线程池能够容纳同时执行的最大线程数，必须大于等于1</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">keepAliveTime:多余的空闲线程的存活时间。超过corePoolSize</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">unit:keepAliveTime的单位</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">workQueue:任务队列，被提交但尚未被执行的任务</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">threadFactory:表示生成线程池中工作线程的线程工厂</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">handler:拒绝策略，当队列满了并且工作线程大于等于线程池的最大线程数</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">底层原理</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">创建线程池，等待任务请求</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">调用execute方法添加一个请求任务</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">如果正在运行的线程数量小于corePoolSize，创建线程运行这个任务</span>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">如果正在运行的线程数量大于或等于corePoolSize，将这个任务放入队列</span>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">如果队列满了且正在运行的线程数量小于maximumPoolSize，创建非核心线程立即运行此任务</span>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">如果队列满了且正在运行的线程数量大于或等于maximumPoolSize，启动饱和拒绝策略</span>
                                                </li>
                                            </ul>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">当一个线程完成任务时，从队列中取下一个任务来执行。</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">某线程空闲超过keepAliveTime时，如果当前运行的线程数大于courseePoolSize，这个线程就被停掉</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">拒绝策略</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">AbortPolicy(默认)：直接抛出RejectedExecutionException异常阻止系统正常运行</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">CallerRunsPolicy：“调用者运行”一种调节机制，将任务回退到调用者</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">DiscardOldestPolicy：抛弃队列中等待最久的任务，将当前任务加入到队列中尝试再次提交</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">DiscardPolicy：直接丢弃任务，不予任何处理也不招聘异常</span>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">死锁编码及定位分析</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">是什么</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">死锁是指两个或两个以上的进程在热点过程中，因争夺资源面造成的一种互相等待的现象，若无外力干涉那它们都将无法推进下去。​</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">主要原因</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">系统资源不足</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">进程运行推进的顺序不合适</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">资源分配不当</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">代码</span>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">解决</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">jps -l 定位进程号</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">jstack pid 找到具体信息</span>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">JVM</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">什么是GC Roots</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">什么是垃圾</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">内存中已经不再被使用到的空间​</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">如何判断一个对象是否可以被回收</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">引用计数法</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">给对象添加一个引用计数器：​每当有一个地方引用它，计数器值加1每当有一个引用失效时，计数器值减1任何时刻计数器值为零的对象就是不可能再被使用的，那么这个对象就是可回收对象很难解决对象之间相互循环引用的问题​​​​</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">枚举根节点做可达性分析</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">`GC roots`或者就`trancing GC`的`根集合`就是一组必需活跃的引用通过一系列名为“GC Roots`的对象作为起点，开始向下搜索，如果一个对象到`GC Roots`没有任何引用链相连时，则说明此对象不可用。​给定一个集合的引用作为根出发，通过引用关系遍历对象图，能被遍历到的（可达到的）​​对象就被判定为存活；没有被遍历到的被判定为死亡</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">case</span>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">可作为`GC Roots`的对象</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">虚拟机栈（栈帧中的局部变量区，也叫局部变量表）中引用的对象</span>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">方法区中的类静态属性引用的对象</span>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">方法区中常量引用的对象</span>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">本地方法栈中JNI（Native方法）引用的对象</span>
                                                        </li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">JVM系统默认值</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">JVM的参数类型</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">标配参数</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-version</span>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-help</span>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java -showversion</span>
                                                </li>
                                            </ul>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">X参数（了解）</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xint 解释执行</span>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xcomp 第一次使用就编译 成本地代码</span>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xmixed 混合模式</span>
                                                </li>
                                            </ul>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">XX参数</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Boolean类型</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">公式</span>
                                                            <ul class="children"
                                                                style="list-style: disc outside; padding-bottom: 4px;">
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:+或者-某个属性值</span>
                                                                </li>
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">+表示开启；-表示关闭</span>
                                                                </li>
                                                            </ul>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Case</span>
                                                            <ul class="children"
                                                                style="list-style: disc outside; padding-bottom: 4px;">
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">是否打印GC收集细节</span>
                                                                    <ul class="children"
                                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                                        <li style="line-height: 24px;"><span
                                                                                class="content mubu-node"
                                                                                style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:+PrintGCDetails</span>
                                                                        </li>
                                                                        <li style="line-height: 24px;"><span
                                                                                class="content mubu-node"
                                                                                style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:-PrintGCDetails</span>
                                                                        </li>
                                                                    </ul>
                                                                </li>
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">是否使用串行垃圾回收器</span>
                                                                </li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">KV设值类型</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">公式</span>
                                                            <ul class="children"
                                                                style="list-style: disc outside; padding-bottom: 4px;">
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:属性key=属性值value</span>
                                                                </li>
                                                            </ul>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Case</span>
                                                            <ul class="children"
                                                                style="list-style: disc outside; padding-bottom: 4px;">
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:MetaspaceSize=1024m</span>
                                                                </li>
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:MaxTenuringThreshold=15</span>
                                                                </li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">jinfo举例，如何查看当前运行程序的配置</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">jps -l</span>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">jinfo -flag PrintGCDetails 24988​</span>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">题外话</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xms</span><br><span
                                                                class="note"
                                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">-XX:InitialHeapSize</span>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xmx</span><br><span
                                                                class="note"
                                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">-XX:MaxHeapSize</span>
                                                        </li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">盘点家底查看JVM默认值</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:+PrintFlagsInitial</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">公式</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java -XX:+PrintFlagsInitial -version</span>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java -XX:+PrintFlagsInitial</span>
                                                        </li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:+PrintFlagsFinal</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">公式</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java -XX:+PrintFlagsFinal -version</span>
                                                        </li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">PrintFlagsFinal举例</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:+PrintCommandLineFlags</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">JVM常用基本配置参数</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xms</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">初始大小内存，默认为物理内存1/64</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">等价于-XX:InitialHeapSize</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xmx</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">最大分配内存，默认为物理内存1/4</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">等价于-XX:MaxHeapSize</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xss</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">设置单个线程栈的大小，一般默认为512K~1024K</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">等价于-XX:ThreadStackSize</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Case。0代表使用默认值。</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">J:\code\demo\java&gt;jinfo -flag ThreadStackSize 2024-XX:ThreadStackSize=0</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xmn</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">设置年轻代大小</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:MetaspaceSize</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">设置元空间大小</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">元空间的本质和永久代类似，都是对JVM规范中方法区的实现。元空间并不在虚拟机中，而是使用本地内存​​</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">典型设置</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-Xms128m -Xmx4g -Xss1m -XX:MetaspaceSize=512m -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseSerialGC</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:+PrintGCDetails</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">输出详细GC收集日志信息</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">-Xms10m -Xmx10mbyte[] bytes = new byte[20 * 1024 * 1024];​​​[GC (Allocation Failure) [PSYoungGen: 1631K-&gt;488K(2560K)] 1631K-&gt;688K(9728K), 0.0008625 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]&nbsp;[GC (Allocation Failure) [PSYoungGen: 488K-&gt;480K(2560K)] 688K-&gt;728K(9728K), 0.0005385 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]&nbsp;[Full GC (Allocation Failure) [PSYoungGen: 480K-&gt;0K(2560K)] [ParOldGen: 248K-&gt;596K(7168K)] 728K-&gt;596K(9728K), [Metaspace: 3109K-&gt;3109K(1056768K)], 0.0041835 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]&nbsp;[GC (Allocation Failure) [PSYoungGen: 0K-&gt;0K(2560K)] 596K-&gt;596K(9728K), 0.0002114 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]&nbsp;[Full GC (Allocation Failure) [PSYoungGen: 0K-&gt;0K(2560K)] [ParOldGen: 596K-&gt;578K(7168K)] 596K-&gt;578K(9728K), [Metaspace: 3109K-&gt;3109K(1056768K)], 0.0035790 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]&nbsp;Exception in thread "main" java.lang.OutOfMemoryError: Java heap space	at com.sloera.jvm.gc.HelloGC.main(HelloGC.java:20)Heap&nbsp;PSYoungGen&nbsp; &nbsp; &nbsp; total 2560K, used 138K [0x00000000ffd00000, 0x0000000100000000, 0x0000000100000000)&nbsp; eden space 2048K, 6% used [0x00000000ffd00000,0x00000000ffd228c8,0x00000000fff00000)&nbsp; from space 512K, 0% used [0x00000000fff00000,0x00000000fff00000,0x00000000fff80000)&nbsp; to&nbsp; &nbsp;space 512K, 0% used [0x00000000fff80000,0x00000000fff80000,0x0000000100000000)&nbsp;ParOldGen&nbsp; &nbsp; &nbsp; &nbsp;total 7168K, used 578K [0x00000000ff600000, 0x00000000ffd00000, 0x00000000ffd00000)&nbsp; object space 7168K, 8% used [0x00000000ff600000,0x00000000ff690988,0x00000000ffd00000)&nbsp;Metaspace&nbsp; &nbsp; &nbsp; &nbsp;used 3165K, capacity 4496K, committed 4864K, reserved 1056768K&nbsp; class space&nbsp; &nbsp; used 346K, capacity 388K, committed 512K, reserved 1048576K</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">GC</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">[GC (Allocation Failure) [PSYoungGen: 1631K-&gt;488K(2560K)] 1631K-&gt;688K(9728K), 0.0008625 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] ​[GC类型[YoungGC前新生代内存占用-&gt;YoungGC后新生代内存占用(新生代总共大小)] YoungGC前JVM堆内存占用-&gt;YoungGC后堆内存占用(JVM堆总大小),YoungGC耗时][Times:YoungGC用户耗时,YoungGC系统耗时,YoungGC实际耗时]​</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">FullGC</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:SurvivorRatio</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">设置新生代中eden和S0/S1空间的比例</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">默认-XX:SurvivorRatio=8;    Eden:S0:S1=8:1:1</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:NewRatio</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">设置年轻代与老年代在堆结的占比</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">默认-XX:NewRatio=2，新生代占1，老年代占2 </span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">-XX:MaxTenuringThreshold</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">设置垃圾最大年龄</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">强/软/弱/虚引用</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">强引用（默认）</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">当内存不足，JVM开始垃圾回收，对于强引用的对象，就算是出现了OOM也不会对该对象进行回收。</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">软引用</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">相对强引用弱化了一些的引用，需要用java.lang.ref.SoftReference类来实现，可以让对象豁免一些垃圾收集。当系统内存充足时不会被回收，当系统内存不足时会被回收。​​</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">弱引用</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">WeakHashMap</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">虚引用</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">主要作用是跟踪对象被接地回收的状态。提供了一种对象被finalize后，做某些事情的机制。</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">虚引用必须和引用队列(ReferenceQueue)联合使用</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">OOM</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java.lang.StackOverflowError</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java.lang.OutOfMemoryError:Java heap space</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java.lang.OutOfMemoryError:GC overhead limit exceeded</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java.lang.OutOfMemoryError:Direct buffer memory</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java.lang.OutOfMemoryError:unable to create new native thread</span><br><span
                                        class="note"
                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">应用创建了超过系统承载极限的线程</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">java.lang.OutOfMemoryError:Metaspace</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">GC垃圾回收算法和垃圾收集器的关系</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">GC算法（引用计数/复制/标清/禁整）是内存回收的方法论，垃圾收集器是算法落地实现。</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">四种主要垃圾收集器</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Serial串行</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">为单线程环境设计且只使用一个线程进行垃圾回收，会暂停所有的用户线程</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Parallel并行</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">多个垃圾收集线程并行工作，此时用户线程是暂停的</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">CMS并发</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">用户线程和垃圾收集线程同时执行（不一定是并行，可能交替），不需要停顿用户线程</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">G1</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">将堆内存分割成不同的区域然后并发的对其进行垃圾回收</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">垃圾收集器</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">如何查看</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">java -XX:+PrintCommandLineFlags -version</span>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">默认的垃圾收集器有哪些</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">UseSerialGC</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">UseSerialOldGC</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">UseParallelGC</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">UseConcMarkSweepGC</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">UseParNewGC</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">UseParallelOldGC</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">UseG1GC</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">垃圾收集器</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">部分参数预先说明</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">DefNew</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">Default New Generation</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">Tenured</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">Old</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ParNew</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">Parallel New Generation</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">PSYoungGen</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">Parallel Scavenge</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">ParOldGen</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">Parallel Old Generation</span>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">新生代</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">串行GC(Serial)/(Serial Copying)</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">对应JVM参数是：-XX:+UseSerialGC开启后会使用：Serial(Young区用)+Serial Old(Old区用)的收集器组合​</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">并行GC(ParNew)</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">对应JVM参数是：-XX:+UseParNewGC 启用ParNew收集器，只影响新生代的收集，不影响老年代开启后会使用：ParNew(Young区用)+Serial Old(Old区用)的收集器组合​。新生代使用复制算法，老年代采用标记-整理算法</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">并行回收GC(Parallel)/(Parallel Scavenge)</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">UseParallelGC与UseParallelOldGC互相激活​使用复制算法，俗称吞吐量优先收集器。​串行收集器在新生代和老年代的并行化。​</span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">可控制的吞吐量</span><br><span
                                                        class="note"
                                                        style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">Thoughput=运行用户代码时间/(运行用户代码时间+垃圾收集时间)</span>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">自适应调节策略</span>
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">老年代</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">串行GC(Serial Old)/(Serial MSC)</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">使用标记整理算法</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">并行GC(Parallel Old)/(Parallel MSC)</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">并发标记清除GC(CMS)</span><br><span
                                                class="note"
                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">以获取最短回收停顿时间为目标开启参数：-XX:+UseConcMarkSweepGC。自动将-XX:UseParaNewGC打开实际使用ParNew+CMS+Serial Old的组合，Serial Old作为CMS出错的后备收集器​​ </span>
                                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">过程步骤</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">初始标记(CMS initial mark)</span><br><span
                                                                class="note"
                                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">标记GC Roots能直接关联的对象，需要暂停所有的工作线程</span>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">并发标记(CMS concurrent mark)和用户线程一起</span><br><span
                                                                class="note"
                                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">进行GC Roots跟踪的过程，和用户线程一起工作。主要标记过程，标记全部对象。</span>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">重新标记(CMS remark)</span><br><span
                                                                class="note"
                                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">修正在并发标记期间，因用户程序运行导致标记产生变动的标记记录。需要暂停所有的工作线程</span>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">并发清除(CMS concurrent sweep)和用户线程一起</span><br><span
                                                                class="note"
                                                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">清除GC Roots不可达对象，基于标记结果，直接清理对象</span>
                                                        </li>
                                                    </ul>
                                                </li>
                                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">优缺点</span>
                                                    <ul class="children"
                                                        style="list-style: disc outside; padding-bottom: 4px;">
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">优</span>
                                                            <ul class="children"
                                                                style="list-style: disc outside; padding-bottom: 4px;">
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">并发收集低停顿</span>
                                                                </li>
                                                            </ul>
                                                        </li>
                                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">缺</span>
                                                            <ul class="children"
                                                                style="list-style: disc outside; padding-bottom: 4px;">
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">并发执行，对CPU资源压力大</span>
                                                                </li>
                                                                <li style="line-height: 24px;"><span
                                                                        class="content mubu-node"
                                                                        style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">采用的标记清除算法会导致大量碎片</span>
                                                                </li>
                                                            </ul>
                                                        </li>
                                                    </ul>
                                                </li>
                                            </ul>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">如何选择垃圾收集器</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">单CPU或小内存，单机程序。-XX:+UseSerialGC多CPU，需要最大吞吐量。-XX:+UseParallelGC 或者 -XX:+UseParallelOldGC多CPU，追求低停顿时间，需快速响应。-XX:+UseConcMarkSweepGC;-XX:+ParNewGC​​</span>
                        </li>
                    </ul>
                </li>
                <li style="line-height: 24px;"><span class="content mubu-node"
                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">G1</span>
                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">以前收集器特点</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">年轻代和老年代是各自独立且连续的内存块</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">年轻代收集使用单eden+S0+S1进行复制算法</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">老年代收集必须扫描整个老年代区域</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">都是以尽可能少而快速地执行GC为设计原则</span>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">G1是什么</span><br><span
                                class="note"
                                style="display: inline-block; color: rgb(136, 136, 136); line-height: 22px; min-height: 22px; font-size: 14px; padding-bottom: 2px;">是一款面向服务端应用的收集器​</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">是一个有整理内存过程的垃圾收集器</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">STW(Stop The World)更可控，用户可以指定期望停顿的时间</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">特点</span>
                                    <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">整体上采用标记-整理算法，局部通过复制算法</span>
                                        </li>
                                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">只有逻辑上的分代概念</span>
                                        </li>
                                    </ul>
                                </li>
                            </ul>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">底层原理</span>
                        </li>
                        <li style="line-height: 24px;"><span class="content mubu-node"
                                                             style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">和CMS相比的优势</span>
                            <ul class="children" style="list-style: disc outside; padding-bottom: 4px;">
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">G1不会产生内在碎片</span>
                                </li>
                                <li style="line-height: 24px;"><span class="content mubu-node"
                                                                     style="line-height: 24px; min-height: 24px; font-size: 16px; padding: 2px 0px; display: inline-block; vertical-align: top;">可以精确配置停顿时间</span>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>

    </body>
</html>